/**接口、静态、包*/
//接口 更抽象的抽象类
    //难点：匿名内部类，
interface Person {
    String getName();
    default void run() {
        System.out.println(getName() + " run");
    }
}
class Student implements Person {
    private String name;

    public Student(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        System.out.println(this.name + " run");
    }

    @Override
    public String getName() {
        return this.name;
    }
}
//静态字段、方法 （不属于实例）static
class Car {
    static String newdate;

    public Car(String newdate) {
        this.newdate= newdate;
    }

}
class BMW extends Car {
    public String cid;


    public BMW(String newdate,String cid) {
        super(newdate);
        this.cid=cid;
    }
    //匿名类
    public void OutputData(){
        System.out.println(newdate+"  id:"+cid);

    }
    class  brake{
        void stop(){
            System.out.println(cid+"stop");
        }
    }

}

public class Main {
    public static void main(String[] args) {
        Student s1 = new Student("S1");
        s1.run();
        BMW c1 = new BMW("2025", "123");
        c1.OutputData();
        BMW.brake bk = c1.new brake();
        bk.stop();
        Person p1 = new Person() {
            @Override
            public String getName() {
                return "Driver";
            }
            public void printABC() {
                System.out.printf("ABC");
            }
        };
        System.out.printf(p1.getName());
        p1.run();


    }
}